package homeWork.SOC4.mission_extra;

/**
 * 汽车测试类
 */
public class VehicleTest {
    public static void main(String[] args){
        //创建汽车对象
        System.out.println("汽车类");
        Vehicle v = new Vehicle("出租车","东风日产",
                4,"粉色");
        v.start();
        v.accelerate();
        v.brake();
        v.stop();

        System.out.println("----------");

        System.out.println("公交车类");
        //创建公交车对象
        //参数列表为2的构造方法
        Bus b1 = new Bus(5,"66路 <--> 88路 路线");
        run(b1);

        System.out.println("---");

        //参数列表为6个的构造方法
        Bus b2 = new Bus("公交车","一汽",6,
                "红黄色",45,"66路 <--> 88路 路线");
        run(b2);
    }

    public static void run(Bus b1) {
        b1.start();
        b1.accelerate();
        b1.annouceBusStop();
        b1.brake();
        b1.stop();
    }
}
